#include "gtest/gtest.h"
#include "../BaseUtil/MyTest.h"
#include "MyVideoTrace.h"
namespace MyVideoTrace {

class VoodooFPointInfoTest : public testing::Test {
protected:
    virtual void SetUp() {
    	fpoint = new VoodooFPointInfo();
    }
    virtual void TearDown() {
    	delete fpoint;
    }

    VoodooFPointInfo * fpoint;
};

TEST_F(VoodooFPointInfoTest, ParseFPointText1) {
	//	string text = "47.3778533936	108.853996277	0	2	-36.0658585504	-35.1602647438	117.359772154	51	1	46.986579895	107.493484497	1";
	//	string text = "302	335	0	2	-1.30879788618	-2.68219694492	42.4612990156	2	0	0		0	0";
	//	string text = "526	25	0	0	0	0	0	0	0	0		0	0";
	//	string text = "364	243	0	2	2.52024005838	-8.31163988577	44.522900075	0	0	0		0	0";
	string text = "59.0449256897	170.381454468	0	2	-24.3741215047	-19.3695123153	78.5429286002	13	1	58.4217910767	168.834152222	65";
	ASSERT_TRUE( fpoint->parseFPointData( text ) );

	ASSERT_FLOAT_EQ( 59.0449256897f, fpoint->getXOffset() );
	ASSERT_FLOAT_EQ( 170.381454468f, fpoint->getYOffset() );
	ASSERT_TRUE( fpoint->isAutomaticallyGenerated() );
	ASSERT_EQ( 2, fpoint->getUnknown1() );
	ASSERT_FLOAT_EQ( -24.3741215047f, fpoint->getXCoord() );
	ASSERT_FLOAT_EQ( -19.3695123153f, fpoint->getYCoord() );
	ASSERT_FLOAT_EQ( 78.5429286002f, fpoint->getZCoord() );
	ASSERT_EQ( 13, fpoint->getFPointID() );
	ASSERT_EQ( 1, fpoint->getUnknown2() );
	ASSERT_FLOAT_EQ( 58.4217910767f, fpoint->getPreviousXOffset() );
	ASSERT_FLOAT_EQ( 168.834152222f, fpoint->getPreviousYOffset() );
	ASSERT_EQ( 65, fpoint->getUnknown3() );
}

}
